#ifndef __PROJECT_WD_H_
#define __PROJECT_WD_H_
#include<func.h>
#include"mySql.h"
typedef struct filemode{//用于实现ll指令
    char type;
    char power[20];

}filemode_t;

void cd(char* path,int sockfd);
void ls(int sockfd);
void pwd(int sockfd);
void do_puts(int sfd,char*cmd);
void do_gets(int sfd, char *cmd);
void mkDir(char*filename,int fd);
int  rm(char*dir,int fd);

void pwd_3th(MYSQL* mysql,char*username,
             int parent_id,int peerfd);

void mkDir_3th(MYSQL*mysql,char*username,int parent_id,
               int owner_id,char*filename,int fd);

void ls_3th(MYSQL*mysql,char*username,
            int parent_id,int sockfd);

void rm_3th(MYSQL*mysql,char*username,char*filename,int parent_id,
            int owner_id,int peerfd);


void rm_judge(MYSQL*mysql,char*username,char*filename,
              char*md5,int parent_id,int owner_id,int peerfd);


int cd_3th(MYSQL*mysql,char*username,
           char*filename,int owner_id,
           int parent_id,int peerfd);

void do_puts_3th(MYSQL*mysql,char*cmd,char*username,
                 char*md5,int peerfd,int parent_id,
                 int owner_id,int filesize);
void do_gets_3th(MYSQL*mysql,char*username,char*filename,
                 int parent_id,int owner_id,int peerfd);

void cd1(char* path);


int recv_file(int sfd, char *filename);
void send_file(int sfd, char *filename);

//命令解析
void splitChar(char* from, char* operate, char* operand);

//用小火车发送
void trainSend(char*buff,int peerfd);
void trainSendPlus(char*buff,int peerfd);

void trainRecv(char*buff,int peerfd);

//指令
int judge(char*order,char*filename,
          int peerfd,MYSQL*mysql,
          int parent_id,char*username,
          int ower_id);
#endif
